package com.xinqing.bigdata.streaming

/**
  * @Author:CHQ
  * @Date:2020 /6/29 9:14
  * @Description
  */
object ScalaSlideWindow {
  def main(args: Array[String]): Unit = {

    val ints: List[Int] = List(1, 2, 3, 4, 5, 6)

    //设置窗口大小、步长
    val iterator: Iterator[List[Int]] = ints.sliding(3, 2)

    for (elem <- iterator) {
      println(elem)
    }
  }
}
